Skip to content

test(label): add Mac sidecar g4 regression test for channel labeler#20

Merged
pretyflaco merged 1 commit into
mainfrom
labeler-mac-sidecar-g4-regression-test
May 14, 2026
Merged

test(label): add Mac sidecar g4 regression test for channel labeler#20
pretyflaco merged 1 commit into
mainfrom
labeler-mac-sidecar-g4-regression-test

Conversation

@pretyflaco
Copy link
Copy Markdown
Owner

Summary

Adds one synthetic regression test to TestLabelSpeakersFromChannels
that pins down the channel labeler's behavior on stereo recordings
produced by meetscribe-record's macOS sidecar at the M4.5 production
default (MicCapture.defaultGain = 4.0, shipped in
meetscribe-record commit 7b4a6fd).

The new test reproduces the per-speaker mic_ratio profile patternn
observed on Apple M1 during M6c.ii.b sign-off (2026-05-14):
you_ratio = 0.240 (target was 0.242 from his run), margin 0.208
over two remote speakers whose ratios sit at 0.032. This forces the
relative-margin branch of the labeler gate
(margin > 0.1 AND you_ratio > 0.15) to be the path under test —
the absolute > 0.5 shortcut intentionally does not fire, because
the Mac path never produces ratios that high.

Why this test, why now

The existing labeler tests cover three regimes:

Test you_ratio
test_assigns_you_to_mic_dominant 0.923
test_no_mic_dominant_speaker_all_remote 0.024
test_sensitive_condenser_mic_…_via_margin 0.593

None of them lands you_ratio in the 0.20–0.30 band that
meetscribe-record produces on macOS in production. The Mac path has
been running through the margin branch since M4.5 closed (see
meetscribe-record PR #5 / issue #6 for the gain decision), but no
test pinned that contract. Future tuning of either side — sidecar
gain on macOS or labeler thresholds in meetscribe — could regress
the Mac path silently.

Verification

  • pytest tests/test_transcribe.py::TestLabelSpeakersFromChannels
    goes from 5 ✓ to 6 ✓ locally on Python 3.10.12 / pytest 8.4.2.
  • The new test's Channel analysis: log line shows
    SPEAKER_00: mic_ratio=0.240, Best candidate ratio=0.240 margin=0.208 over avg=0.032, and final labels
    {SPEAKER_00: YOU, SPEAKER_01: REMOTE_1, SPEAKER_02: REMOTE_2}
    matching the M4.5 g4 expectation.

Context

Add `test_mac_sidecar_g4_default_assigns_you_via_margin` to
`TestLabelSpeakersFromChannels`, a synthetic stereo fixture calibrated
to reproduce the per-speaker `mic_ratio` profile that meetscribe-record
produces on macOS at the M4.5 production default
(`MicCapture.defaultGain = 4.0`, shipped in
meetscribe-record 7b4a6fd).

The existing labeler tests cover three regimes well:

  - `test_assigns_you_to_mic_dominant`         you_ratio = 0.923
  - `test_no_mic_dominant_speaker_all_remote`  you_ratio = 0.024
  - `test_sensitive_condenser_mic_…_margin`    you_ratio = 0.593

None of them lands `you_ratio` in the 0.20-0.30 band that the Mac
sidecar actually produces — the band where the labeler's absolute
`> 0.5` shortcut does not fire and the relative-margin branch
(`margin > 0.1 AND you_ratio > 0.15`) is the only thing assigning the
YOU label.  The Mac path has been running through that margin branch
since M4.5 closed, but no test pinned it down.  Any future tuning of
either side — sidecar gain, labeler thresholds — could regress it
silently.

Calibration source is patternn's M6c.ii.b sign-off run (2026-05-14,
meetscribe-record 0.2.0a1, Apple M1 / macOS 26.4.1), which reported
`you_ratio = 0.242` after a controlled stereo recording.  The new
test reproduces that ratio almost exactly: `mic_ratio = 0.240` with
margin 0.208 over the two synthetic remote speakers (whose ratios
sit near 0.032).  Three speakers (one YOU, two REMOTE) so the
`REMOTE_1`/`REMOTE_2` branch is exercised.

This is part of M7 in epic pretyflaco/meetscribe-record#1.  Live
end-to-end validation against patternn's actual Mac WAV is the
matching deliverable; the synthetic test here is the contract that
keeps the Mac path from drifting between runs.
@pretyflaco pretyflaco merged commit 3f20520 into main May 14, 2026
1 check passed
@pretyflaco pretyflaco deleted the labeler-mac-sidecar-g4-regression-test branch May 14, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant